import Vue from 'vue'  //加载vue
import Router from 'vue-router' //加载 vue-router
//引入组件
import Home from '@/pages/home/Home'
import City from '@/pages/city/City'
import Detail from '@/pages/detail/Detail'
// @ 表示的是当前的  src 目录
Vue.use(Router);//使用路由

//路由默认配置
export default new Router({
  routes: [
    {
      path: '/',
      name: 'Home',
      component: Home
    },
    {//配置城市路由
      path: '/city',
      name: 'City',
      component: City
    },
    {//配置详情页面路由
      path: '/detail/:id',
      name: 'Detail',
      component: Detail
    }
  ]
})
